package kr.hkit.androidcomplete02.ch12;

import java.util.*;

import kr.hyunist.androidcomplete01.*;
import android.app.*;
import android.os.*;
import android.widget.*;

public class ListViewEx extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch12_listviewarraylist);
		
		//데이터 원본 준비
		ArrayList<String> arList = new ArrayList<String>();
		arList.add("김유신");
		arList.add("이순신");
		arList.add("강감찬");
		arList.add("을지문덕");
	
		//어댑터 준비
		ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, arList);
		
		//어댑터 연결
		ListView list =  (ListView) findViewById(R.id.ch12_listView);
		list.setAdapter(adapter);
		
	}
}
